package cn.readjava.bean;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "user_order", schema = "readjava", catalog = "")
public class UserOrder implements Serializable {
    private long orderId;
    private Long orderUserId;
    private Long orderVcId;
    private String orderContent;
    private String orderNo;
    private String orderOutNo;
    private String orderPrice;
    private String orderTime;

    @Id
    @Column(name = "order_id", nullable = false)
    public long getOrderId() {
        return orderId;
    }

    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "order_user_id", nullable = true)
    public Long getOrderUserId() {
        return orderUserId;
    }

    public void setOrderUserId(Long orderUserId) {
        this.orderUserId = orderUserId;
    }

    @Basic
    @Column(name = "order_vc_id", nullable = true)
    public Long getOrderVcId() {
        return orderVcId;
    }

    public void setOrderVcId(Long orderVcId) {
        this.orderVcId = orderVcId;
    }

    @Basic
    @Column(name = "order_content", nullable = true, length = 255)
    public String getOrderContent() {
        return orderContent;
    }

    public void setOrderContent(String orderContent) {
        this.orderContent = orderContent;
    }

    @Basic
    @Column(name = "order_no", nullable = true, length = 255)
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Basic
    @Column(name = "order_out_no", nullable = true, length = 255)
    public String getOrderOutNo() {
        return orderOutNo;
    }

    public void setOrderOutNo(String orderOutNo) {
        this.orderOutNo = orderOutNo;
    }

    @Basic
    @Column(name = "order_price", nullable = true, length = 255)
    public String getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(String orderPrice) {
        this.orderPrice = orderPrice;
    }

    @Basic
    @Column(name = "order_time", nullable = true, length = 255)
    public String getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(String orderTime) {
        this.orderTime = orderTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserOrder userOrder = (UserOrder) o;
        return orderId == userOrder.orderId &&
                Objects.equals(orderUserId, userOrder.orderUserId) &&
                Objects.equals(orderVcId, userOrder.orderVcId) &&
                Objects.equals(orderContent, userOrder.orderContent) &&
                Objects.equals(orderNo, userOrder.orderNo) &&
                Objects.equals(orderOutNo, userOrder.orderOutNo) &&
                Objects.equals(orderPrice, userOrder.orderPrice) &&
                Objects.equals(orderTime, userOrder.orderTime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(orderId, orderUserId, orderVcId, orderContent, orderNo, orderOutNo, orderPrice, orderTime);
    }
}
